<template>
  <div class="main-page">
    <div class="page">
      <div class="page-header">
        <div class="page-header-left">
          <van-icon name="arrow-left" @click="onback" />
        </div>
        <div class="page-share">
          <van-icon name="share-o" @click="showShare = true" />
          <van-share-sheet
            v-model:show="showShare"
            :options="options"
            title="立即分享给好友"
            description="描述信息"
          />
        </div>
      </div>
      <div class="page-body">
        <div class="page-body-center">
          <div class="logo-image">
            <van-image
              round
              width="80px"
              height="80px"
              src="https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg"
            />
            <div class="logo-name"><span>小小程序猿</span></div>
          </div>
          <van-cell-group inset>
            <van-field
              v-model="value"
              title=""
              placeholder="编辑个性签名让更多的人认识你吧"
            />
          </van-cell-group>
          <div class="page-swipe">
            <van-cell is-link title="在学课程"  @click="ongetCourse"/>
            <van-swipe :autoplay="3000" lazy-render>
              <van-swipe-item v-for="image in images" :key="image">
                <img :src="image" />
              </van-swipe-item>
            </van-swipe>
          </div>
          <div>
            <h4>动态</h4>
            <span class="txt-time">{{dayjs().format("YYYY.MM.DD HH:mm")}}</span><br>
            <span>谈谈对写代码后感受吧，头发都没了</span>
            <p>JAVA#C++#C</p>
            <van-image
              width="100%"
              height="150"
              src="https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg"
            />
            <div class="title-icon">
              <van-icon name="share-o" @click="showShare = true">
                <span class="spen-size">2535</span>
                </van-icon>
              <van-icon name="smile-comment-o">
                <span class="spen-size">1200</span>
                </van-icon>
              <van-icon name="like-o">
                <span class="spen-size">8912</span>
                </van-icon>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default { name: "page" };
</script>
<script setup>
import dayjs from "dayjs";
import { ref } from "vue";
import { useRouter } from "vue-router";
const value=ref('');
const showShare = ref(false);
const options = [
  { name: "微信", icon: "wechat" },
  { name: "微博", icon: "weibo" },
  { name: "复制链接", icon: "link", description: "描述信息" },
  { name: "分享海报", icon: "poster" },
  { name: "二维码", icon: "qrcode" },
];
const images = [
  "https://fastly.jsdelivr.net/npm/@vant/assets/apple-1.jpeg",
  "https://fastly.jsdelivr.net/npm/@vant/assets/apple-2.jpeg",
];
const router = useRouter();
function onback() {
  router.push("/mine");
}
function ongetCourse(){
  router.push("/course")
}
</script>
<style lang="scss" scoped>
.main-page {
  width: 100%;
  height: 100%;
  overflow: auto;
  .page {
    height: 100%;
    &-header {
      height: 200px;
      width: 100%;
      background-color: orange;
      position: relative;
      .page-share {
        position: absolute;
        top: 20px;
        right: 20px;
      }
      .van-icon {
        color: #fff;
        font-size: 30px;
      }
      &-left {
        position: absolute;
        top: 20px;
        position: absolute;
        top: 20px;
        left: 20px;
      }
    }
    &-body {
      width: 100%;
      height: 100%;
      border: 1px solid #fff;
      position: relative;
      &-center {
        width: 100%;
        height: 100%;
        background-color: #fff;
        margin-top: -50px;
        border: 1px solid #fff;
        border-radius: 30px;
        position: relative;
        .logo-image {
          margin-top: -30px;
          margin-left: 20px;
          height: 80px;
          line-height: 60px;
          width: 100%;
          position: relative;
          display: flex;
          .logo-name {
            position: absolute;
            flex: 1;
            left: 100px;
            top: 20px;
            font-size: 20px;
          }
        }
        .page-swipe {
          height: 210px;
          width: 94%;
          margin: 10px;
          border: 1px solid #999999;
          overflow: hidden;
          font-weight: bold;
          .van-swipe-item {
            height: 150px;
            img {
              height: 150px;
            }
          }
        }
      }
      p {
        color: blue;
      }
      .title-icon {
        .van-icon {
          margin-left: 40px;
          font-size: 30px;
          line-height: 30px;
          .spen-size {
            font-size: 14px;
            margin-left: 5px;
          }
        }
      }
    }
  }
}
</style>
